$(function(){
    $("#form").click(function(){
        var name=$("#name").val();
        var userId=$("#userId").val();
        var amt=$("#amt").val();
        var idtype=$("#idtype").val();
        var idno=$("#idno").val();
        var bankCard = $("#bankCard").val();
        var homeUrl = $("#homeUrl").val();
        $.post("/fuyou/authenticationPay","name="+name+"&userId="+userId+"&amt="+amt+"&bankCard="+bankCard+"&idtype="+idtype+"&idno="+idno+"&homeUrl="+homeUrl+"&meridPay="+""+"&pwdKey="+""+"&callbackUrl="+"www.baidu.com",
            function(data){
                console.info("data：========="+data.data);
                var resultDate = JSON.parse(data.data);
                console.info("resultDate："+resultDate.ENCTP+"====="+resultDate.VERSION+"====="+resultDate.MCHNTCD+"====="+resultDate.FM);
                $("#ENCTP").val(resultDate.ENCTP);
                $("#VERSION").val(resultDate.VERSION);
                $("#MCHNTCD").val(resultDate.MCHNTCD);
                $("#FM").val(resultDate.FM);
                sub()
            },"json"
        )
    })

    function sub(){
        $("#form2").submit();
    }
})